cmake_minimum_required(VERSION 3.16)
project(SDL_Teris C)

set(CMAKE_C_STANDARD 99)

#SDL2所在目录
set(SDL2_DIR D:\\SDL2\\SDL2-2.0.14\\x86_64-w64-mingw32)
#SDL2 Image所在目录
set(SDL2IMAGE_DIR D:\\SDL2\\SDL2_image-2.0.5\\x86_64-w64-mingw32)
#SDL2 ttf所在目录
set(SDL2TTF_DIR D:\\SDL2\\SDL2_ttf-2.0.15\\x86_64-w64-mingw32)
#SDL2 mixer所在目录
set(SDL2MIXER_DIR D:\\SDL2\\SDL2_mixer-2.0.4\\x86_64-w64-mingw32)

aux_source_directory(./ SRC) #源文件目录(当前目录设置到变量DIR_SRC)


# include目录
include_directories(${SDL2_DIR}\\include\\SDL2)
include_directories(${SDL2IMAGE_DIR}\\include\\SDL2)
include_directories(${SDL2TTF_DIR}\\include\\SDL2)
include_directories(${SDL2MIXER_DIR}\\include\\SDL2)

#库目录
link_directories(${SDL2_DIR}\\lib)
link_directories(${SDL2IMAGE_DIR}\\lib)
link_directories(${SDL2TTF_DIR}\\lib)
link_directories(${SDL2MIXER_DIR}\\lib)
# 库
#link_libraries(mingw32 SDL2main SDL2 SDL2_image SDL2_ttf SDL2_mixer)
link_libraries(mingw32 SDL2main SDL2)

#add_executable(SDL_Demo WIN32 ${DIR_SRC}) # WIN32 去掉控制台（windows环境）
add_executable(SDL_Demo ${SRC})
target_sources(SDL_Demo  PRIVATE ${DIR_SRC})